package com.ts.conch.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ts.conch.common.result.CommonResult;
import com.ts.conch.entity.TsMenu;
import com.ts.conch.entity.TsRole;

import java.util.List;
import java.util.Map;

public interface ItsRoleService extends IService<TsRole> {

    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method create
     * create by: IDai
     * description: 添加角色
     * create time: 2020-08-17 16:35
     * @Param: [role]
     */
    CommonResult<?> create(TsRole role);

    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method update
     * create by: IDai
     * description: 修改角色信息
     * create time: 2020-08-17 16:35
     * @Param: [role]
     */
    CommonResult<?> update(TsRole role);

    /**
     * @return com.lr.iboot.common.result.CommonResult<com.lr.iboot.api.entity.LrRole>
     * @method updateRoleStatus
     * create by: IDai
     * description: 修改指定角色的状态
     * create time: 2020-08-25 17:22
     * @Param: []
     */
    CommonResult<TsRole> updateRoleStatus(Map<String, Object> params);

    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method delete
     * create by: IDai
     * description: 批量删除角色
     * create time: 2020-08-17 16:35
     * @Param: [roleId]
     */
    CommonResult<?> delete(String roleId);


    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method list
     * create by: IDai
     * description: 获取所有角色列表
     * create time: 2020-08-17 16:35
     * @Param: []
     */
    CommonResult<?> list(String enterpriseId);

    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method list
     * create by: IDai
     * description: 分页获取角色列表
     * create time: 2020-08-17 16:35
     * @Param: [params]
     */
    CommonResult<?> list(Map<String, Object> params);

    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method getMenuList
     * create by: IDai
     * description: 根据管理员ID获取对应菜单
     * create time: 2020-08-17 16:35
     * @Param: [adminId]
     */
    CommonResult<?> getMenuList(String adminId);

    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method listMenu
     * create by: IDai
     * description: 获取角色相关菜单
     * create time: 2020-08-17 16:34
     * @Param: [roleId]
     */
    CommonResult<List<TsMenu>> listMenu(String roleId);

    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method listResource
     * create by: IDai
     * description: 获取角色相关资源
     * create time: 2020-08-17 16:34
     * @Param: [roleId]
     */
    CommonResult<?> listPermission(String roleId);

    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method allocMenu
     * create by: IDai
     * description: 给角色分配菜单
     * create time: 2020-08-17 16:34
     * @Param: [roleId, menuIds]
     */
    CommonResult<?> allocMenu(String roleId, List<String> menuIds);

    /**
     * @return com.lr.iboot.common.result.CommonResult
     * @method allocResource
     * create by: IDai
     * description: 给角色分配资源
     * create time: 2020-08-17 16:34
     * @Param: [roleId, resourceIds]
     */
    CommonResult<?> allocPermission(String roleId, List<String> permissionIds);

    /**
     * @return com.lr.iboot.common.result.CommonResult<java.util.List < java.util.Map>>
     * @method queryAdminResourceBtn
     * create by: IDai
     * description: 查询出当前用户所能查看的前端按钮资源
     * create time: 2020-09-02 9:53
     * @Param: [adminId]
     */
    CommonResult<List<Map<String, Object>>> queryAdminResourceBtn(String adminId);

}
